package com.study.mybatis.demo.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.study.mybatis.demo.model.UserInfo;

public interface UserMapper {
	
	@Insert("insert into user(user_name,password,memo) values(#{userName},#{password},#{memo})")
	public void insert(UserInfo info);
	
	@Delete("delete from user where id=#{id}")
	public void delete(int id);
	
	@Select("select id,user_name userName,password,memo from user where id=#{id}")
    public UserInfo getUser(int id);
    
    @Select("select id,user_name userName,password,memo from user")
    public List<UserInfo> getAllUsers();

}
